<!-- route: /authentication name: authentication-->
<template>
  <div class="authentication">
    <div class="header">
      <div class="margin-left1">
        <img src="@/assets/img/layout/logo.png" alt="" class="logo">
      </div>
      <div style="margin: 0 20px">|</div>
      <div class="title">实名认证</div>
    </div>
    <div class="content">
      <div class="contentTop">
        <span style="margin-left: 20px">企业实名认证</span>
        <div style="margin-right: 20px;display: flex;align-items: center">
          <img src="https://asset.tsign.cn/apps/realname_v3/prod/2.0.2/img/helpeCenter.168bc7c6.svg" alt="">
          <span style="margin-left: 4px;cursor: pointer" @click="goHelp">帮助文档</span>
        </div>
      </div>
      <div class="contentPage">
        <div class="steps">
          <el-steps :active="current" :align-center="true">
            <el-step title="组织信息核验"></el-step>
            <el-step title="法人授权认证"></el-step>
            <el-step title="认证结果"></el-step>
          </el-steps>
        </div>
        <first-auth :companyInfo="keyword" v-show="current === 1" @goIndex="setCurrent" @getCompanyInfo="getCompanyInfo"/>
        <second-auth :pageInfo="pageInfo" v-show="current === 2" @goIndex="setCurrent"/>
        <third-auth v-show="current === 3" @goIndex="setCurrent"/>
      </div>
      <div class="contentFooter">
        <img src="https://www.signzg.com/favicon.ico" alt="">
        大鸿签提供技术支持
      </div>
    </div>
  </div>
</template>

<script>

import FirstAuth from "@/views/authentication/firstAuth.vue";
import SecondAuth from "@/views/authentication/thecondAuth.vue";
import ThirdAuth from "@/views/authentication/thirdAuth.vue";
import { getAuthenticationInfo } from "@/api/company";

export default {
  name: "authentication",
  components: {ThirdAuth, SecondAuth, FirstAuth},
  data() {
    return {
      current: 1,
      keyword: JSON.parse(localStorage.getItem('servicekeywords')),
      pageInfo: {
        src: '',
        id: '',
        link: ''
      }
    }
  },
  mounted() {},
  methods:{
    // 帮助中心
    goHelp(){
      window.open('https://www.signzg.com/#/helpCenter')
    },
    // 步骤条进度
    setCurrent(i){
      this.current = i
    },
    // 获取邀请二维码的企业三要素
    getCompanyInfo(info){
      this.pageInfo = info
      // getAuthenticationInfo({enterpriseId: id}).then(res=>{
      //   if(res.code === 200){
      //     console.log(res);
      //   }
      // })
    }
  }
}
</script>

<style scoped lang="scss">
.authentication{
  background-color: #f4f5f9;
  height: calc(100vh - 80px);
  .header{
    background-color: #262729;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    height: 60px;
    display: flex;
    align-items: center;
    color: #FFFFFF;
  }
  .logo {
    width: 110px;
    height: auto;
    margin-top: 5px;
  }
  .content{
    width: 60vw;
    margin: 80px auto 0;
    background-color: #FFFFFF;
    -webkit-box-shadow: 0 4px 10px 0 rgba(0,0,0,.1);
    box-shadow: 0 4px 10px 0 rgba(0,0,0,.1);
    box-sizing: border-box;
    min-height: calc(100vh - 80px);
    position: relative;
    padding-bottom: 20px;
    .contentTop{
      border-radius: 8px 8px 0 0;
      border-bottom: 1px solid #f2f3f5;
      height: 50px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 14px;
    }
    .contentPage{
      .steps{
        margin: 20px auto 10px;
        width: 80%;
      }
    }
    .contentFooter{
      width: 100%;
      position: absolute;
      bottom: 20px;
      left: 0;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      font-size: 14px;
      img{
        margin-right: 5px;
      }
    }
  }
}
</style>